package com.ggs.rg.ybjb.pojomodule.pojo;

import com.baomidou.mybatisplus.annotation.*;
import java.util.Date;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author lez
 * @since 2021-11-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TComment对象", description="")
@NoArgsConstructor
@AllArgsConstructor
public class TComment implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键，自增，唯一值")
    @TableId(value = "cid", type = IdType.AUTO)
    private Integer cid;

    @ApiModelProperty(value = "评论")
    private String text;

    @ApiModelProperty(value = "评论图片")
    private String image;

    @ApiModelProperty(value = "关联用户表，外键约束")
    private String phone;

    @ApiModelProperty(value = "关联商品表，外键约束")
    private Integer pid;

    @ApiModelProperty(value = "关联订单表，外键约束")
    private String oid;

    @ApiModelProperty(value = "管理员回复")
    private String textManage;

    @ApiModelProperty(value = "数据生成时自动创建时自动")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "数据生成时自动生成，修改时自动更新")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "乐观锁")
    @Version
    private Integer version;

    //关联用户表
    @TableField(exist = false)
    private TUser tUsers;

    //逻辑删除
    @TableLogic
    private Byte deletes;

    public TComment(String text, String image, String phone, Integer pid) {
        this.text = text;
        this.image = image;
        this.phone = phone;
        this.pid = pid;
    }

    public TComment(String text, String image, String phone, Integer pid, String oid) {
        this.text = text;
        this.image = image;
        this.phone = phone;
        this.pid = pid;
        this.oid = oid;
    }


    public TComment(String text,String phone,Integer pid,String oid) {
        this.text = text;
        this.phone = phone;
        this.pid = pid;
        this.oid = oid;
    }

    public TComment(Integer cid, String textManage) {
        this.cid = cid;
        this.textManage = textManage;
    }
}
